package com.margo.project.retry.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.margo.project.retry.exception.MargoRetryException;
import com.margo.project.retry.service.MargoRetryService;

@Controller
@RequestMapping("/retry")
public class MargoRetryController {

	@Autowired
	private MargoRetryService margoRetryService;
	
	@RequestMapping("/sendMsg")
	@ResponseBody
	public String senMsg() {
		margoRetryService.sendMsg();
		return "OK";
	}
	
	@RequestMapping("/sendExceptionMsg")
	@ResponseBody
	public String sendExceptionMsg() throws MargoRetryException {
		margoRetryService.sendExceptionMsg();
		return "OK";
	}
}
